import request from '@/utils/request'

export const userApi = {
  // 用户注册
  register(data) {
    return request({
      url: '/users/register',
      method: 'post',
      data
    })
  },

  // 用户登录
  login(data) {
    return request({
      url: '/users/login',
      method: 'post',
      data
    })
  },

  // 获取用户信息
  getUserInfo(userId) {
    return request({
      url: `/users/${userId}`,
      method: 'get'
    })
  },

  // 更新用户信息
  updateUser(userId, data) {
    return request({
      url: `/users/${userId}`,
      method: 'put',
      data
    })
  },

  // 删除用户
  deleteUser(userId) {
    return request({
      url: `/users/${userId}`,
      method: 'delete'
    })
  }
} 